from django.shortcuts import render, redirect, HttpResponse
from utils.alipay import AliPay
from utils.alipay_link import alipay_link
from django.conf import settings


def game_info(request):
    # if request.method == "GET":
    #     number = request.GET.get("number", "")
    #
    #     print(type(number))
    #     if int(number) < 1:
    #         return render(request, 'game_info.html')
    return render(request, 'game_info.html')


def game_num(request):
    number = request.GET.get("number", "")

    if int(number) < 10:
        return HttpResponse("充值金额不能少于10块")
    url = alipay_link(1244, "充值金额", number)
    return redirect(url)
